package com.study.demo.aop.proxy.jdk;

/**
 * jdk 代理
 * @author: elvin
 * @time: 2019-10-09 16:52
 * @desc:
 **/
public class Start {
    public static void main(String[] args) {
        IStudyService study = new StudyService();
        System.out.println("---------没有jdk代理时------------");
        study.studyChinese("小明");
        study.studyEnglish("小明");

        StudyJDKProxy proxy = new StudyJDKProxy();
        proxy.setTarget(study);
        IStudyService studyProxy =(IStudyService) proxy.createProxyObj();
        System.out.println("---------被jdk代理时------------");
        studyProxy.studyChinese("小明");
        System.out.println("--------------------------");
        studyProxy.studyEnglish("小明");
    }
}
